<?php

/**
 * This is the model class for table "hargasayuran".
 *
 * The followings are the available columns in table 'hargasayuran':
 * @property integer $hs_id
 * @property integer $hs_bulan
 * @property integer $hs_ketimun
 * @property integer $hs_kacangpanjang
 * @property integer $hs_cabehijau
 * @property integer $hs_tomatsayur
 * @property integer $hs_buncis
 * @property integer $hs_kangkung
 * @property integer $hs_tahun
 */
class Hargasayuran extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Hargasayuran the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'hargasayuran';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('hs_bulan, hs_ketimun, hs_kacangpanjang, hs_cabehijau, hs_tomatsayur, hs_buncis, hs_kangkung, hs_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('hs_id, hs_bulan, hs_ketimun, hs_kacangpanjang, hs_cabehijau, hs_tomatsayur, hs_buncis, hs_kangkung, hs_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'hs_id' => 'Hs',
			'hs_bulan' => 'Hs Bulan',
			'hs_ketimun' => 'Hs Ketimun',
			'hs_kacangpanjang' => 'Hs Kacangpanjang',
			'hs_cabehijau' => 'Hs Cabehijau',
			'hs_tomatsayur' => 'Hs Tomatsayur',
			'hs_buncis' => 'Hs Buncis',
			'hs_kangkung' => 'Hs Kangkung',
			'hs_tahun' => 'Hs Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('hs_id',$this->hs_id);
		$criteria->compare('hs_bulan',$this->hs_bulan);
		$criteria->compare('hs_ketimun',$this->hs_ketimun);
		$criteria->compare('hs_kacangpanjang',$this->hs_kacangpanjang);
		$criteria->compare('hs_cabehijau',$this->hs_cabehijau);
		$criteria->compare('hs_tomatsayur',$this->hs_tomatsayur);
		$criteria->compare('hs_buncis',$this->hs_buncis);
		$criteria->compare('hs_kangkung',$this->hs_kangkung);
		$criteria->compare('hs_tahun',$this->hs_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}